package top.wardyan.wdev.dbdevassist.po;

/**
 * 1废弃(锁定), 2编辑, 3提交, 4复核, 5审核(锁定), 6锁定. 锁定时不允许其他人修改,只允许拥有者修改
 * @author ward
 */
public class Status {
	
	private int sID;
	private String xName;
	public static final String STR1 = "废弃(锁定)";
	public static final String STR2 = "编辑";
	public static final String STR3 = "提交";
	public static final String STR4 = "复核";
	public static final String STR5 = "审核(锁定)";
	public static final String STR6 = "锁定";
	
	public static final Status STATUS1 = new Status(1);
	public static final Status STATUS2 = new Status(2);
	public static final Status STATUS3 = new Status(3);
	public static final Status STATUS4 = new Status(4);
	public static final Status STATUS5 = new Status(5);
	public static final Status STATUS6 = new Status(6);
	
	
	private Status(int sID) {
		this.sID = sID;
		switch(sID) {
		case 1:
			this.xName = STR1;
			break;
		case 2:
			this.xName = STR2;
			break;
		case 3:
			this.xName = STR3;
			break;
		case 4:
			this.xName = STR4;
			break;
		case 5:
			this.xName = STR5;
			break;
		case 6:
			this.xName = STR6;
			break;
		default:
			this.xName = STR1;
			break;
		}
	}
		
	public static Status getInstance(int sStatus) {
		Status rs = null;
		switch(sStatus) {
		case 1:
			rs = STATUS1;
			break;
		case 2:
			rs = STATUS2;
			break;
		case 3:
			rs = STATUS3;
			break;
		case 4:
			rs = STATUS4;
			break;
		case 5:
			rs = STATUS5;
			break;
		case 6:
			rs = STATUS6;
			break;
		default:
			rs = STATUS1;
			break;
		}
		return rs;
	}
	
	public static Status getInstance(String sStatus) {
		Status rs = null;
		switch(sStatus) {
		case STR1:
			rs = STATUS1;
			break;
		case STR2:
			rs = STATUS2;
			break;
		case STR3:
			rs = STATUS3;
			break;
		case STR4:
			rs = STATUS4;
			break;
		case STR5:
			rs = STATUS5;
			break;
		case STR6:
			rs = STATUS6;
			break;
		default:
			rs = STATUS1;
			break;
		}
		return rs;
	}
	
	public int getSID() {
		return sID;
	}
	public Status setSID(int sID) {
		this.sID = sID;
		return this;
	}
	public String getXName() {
		return xName;
	}
	public Status setXName(String xName) {
		this.xName = xName;
		return this;
	}
	
	

}
